 #@layout()
 #define content()

<span class="layui-breadcrumb">
  <a href="/">首页</a>
  <a href="/admin/myWebsiteContact"><cite>联系我们</cite></a>
</span>

<hr>


<div class="layui-field-box">
<form class="layui-form">
    <div class="layui-form-item">
    		<div class="layui-inline">
	      <label class="layui-form-label">搜索内容</label>
	      <div class="layui-input-inline">
	        <input type="text" name="searchContent" autocomplete="off" class="layui-input" placeholder="请输入内容搜索">
	      </div>
	    </div>
	    
	    <button class="layui-btn" type="button" id="btnSearch">搜索</button>
	    <button class="layui-btn layui-btn-normal" type="reset" >重置</button>
	    
	</div>
</form>	    
</div>
  
<table class="layui-hide" id="dataTable"></table>

#end

#define js()

<script>

layui.use('table', function() {
	
	var table = layui.table;
	table.render({
		elem : '#dataTable',
		url : '/admin/myWebsiteContact/pagequery',
		cols : [ [
	      {field:'name', title: '姓名',width:100},
	      {field:'email', title: '邮箱'},
	      {field:'phone', title: '电话',width:120},
	      {field:'address', title: '地址'},
	      {field:'createTime', title: '创建时间',width:180},
	      {field:'message', title: '留言'}
		] ],
		page : true
	});
	
	$("#btnSearch").click(function(){
		
		var searchContent=$(":input[name='searchContent']").val();
		
		//执行重载
		table.reload('dataTable', {
			page : {
				curr : 1//重新从第 1 页开始
			},
			where : {
				searchContent:searchContent,
			}
		});
		
	});

});

</script>

#end


